package com.party.orders.dto;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author Caizhf
 * @date 2017年8月14日上午1:24:03
 * @version v.0.1
 * @email 1115054416@qq.com 
 *
 * <p>Description:单类商品基础计算传输DTO </p>
 *
 */
public class ProductBaseAmountDTO {
	
	protected double totalAmount;					//该类商品的原总价
	protected double couponToalReduce;				//该类商品优惠券优惠总价
	protected double actualPay;						//该类商品的实际支付金额
	protected List<ShopCartAmountDTO> shopCarts;	//该产品下的所有清单以及实际付款金额(因为有优惠券存在)

	
	
	public ProductBaseAmountDTO() {
		super();
		shopCarts = new ArrayList<ShopCartAmountDTO>();
	}
	
	public void addCouponTotalReduce(double amount){
		this.couponToalReduce += amount;
	}
	
	public ProductBaseAmountDTO addProductShopCartAmount(ShopCartAmountDTO shopCartAmount){
		if(null!=shopCarts)
			shopCarts.add(shopCartAmount);
		return this;
	}
	
	public double getActualPay() {
		actualPay = totalAmount - couponToalReduce;
		return actualPay;
	}

	public void setActualPay(double actualPay) {
		this.actualPay = actualPay;
	}

	public double getTotalAmount() {
		return totalAmount;
	}
	public void setTotalAmount(double totalAmount) {
		this.totalAmount = totalAmount;
	}
	public double getCouponToalReduce() {
		return couponToalReduce;
	}
	public void setCouponToalReduce(double couponToalReduce) {
		this.couponToalReduce = couponToalReduce;
	}
	public List<ShopCartAmountDTO> getShopCarts() {
		return shopCarts;
	}
	public void setShopCarts(List<ShopCartAmountDTO> shopCarts) {
		this.shopCarts = shopCarts;
	}
	
	public void addTotalAmount(double amount){
		this.totalAmount += amount;
	}

	@Override
	public String toString() {
		return "ProductBaseAmountDTO [totalAmount=" + totalAmount + ", couponToalReduce=" + couponToalReduce
				+ ", actualPay=" + actualPay + ", shopCarts=" + shopCarts + "]";
	}

	
}


